function costs = cmaesParallelSplit(gainsPop)
    global rtp InitialGuess
    %allocate costs vector and paramsets the generation
    popSize = size(gainsPop,2);
    costs = nan(1,popSize);
    paramSets = cell(popSize,1);

    %create param sets
    for i = 1:popSize
        Gains = InitialGuess.*exp(gainsPop(:,i));
        paramSets{i} = Simulink.BlockDiagram.modifyTunableParameters(rtp, ...
            'GainGAS',               Gains( 1), ...
            'GainGLU',               Gains( 2), ...
            'GainHAM',               Gains( 3), ...
            'GainKneeOverExt',       Gains( 4), ...
            'GainSOL',               Gains( 5), ...
            'GainSOLTA',             Gains( 6), ...
            'GainTA',                Gains( 7), ...
            'GainVAS',               Gains( 8), ...
            'Kglu',                  Gains( 9), ...
            'PosGainGG',             Gains(10), ...
            'SpeedGainGG',           Gains(11), ...
            'hipDGain',              Gains(12), ...
            'hipPGain',              Gains(13), ...
            'kneeExtendGain',        Gains(14), ...
            'kneeFlexGain',          Gains(15), ...
            'kneeHoldGain1',         Gains(16), ...
            'kneeHoldGain2',         Gains(17), ...
            'kneeStopGain',          Gains(18), ...
            'legAngleFilter',        Gains(19), ...
            'legLengthClr',          Gains(20), ...
            'simbiconGainD',         Gains(21), ...
            'simbiconGainV',         Gains(22), ...
            'simbiconLegAngle0',     Gains(23));
    end

    %simulate each sample and store cost
    parfor i = 1:popSize
        costs(i) = evaluateCostParallel(paramSets{i})
    end
